<%-- 
    Document   : diagrammeditor
    Created on : Jul 21, 2011, 12:18:11 AM
    Author     : cedric.creusot
--%>


<div class="titleContainer">
    <h1><spring:message code="diagrameditor.maintitle"/>: ${diagramm.name}</h1>
</div>

<div class="module">
<canvas id="CaseTool" class="UmlCanvas withoutInspector" 
        width="${diagramm.width}" height="${diagramm.height}">
</canvas>
</div>
<br>
<logic:equal name="userid" value="${project.ownerId}">
    <form:form modelAttribute="diagramm" class="module">
        <div class="element">
        <label><spring:message code="diagrameditor.editor"/>: </label>
        <form:select path="editor" id="select">
            <c:forEach var="users" items="${usersList}">
                <option>${users}</option>    
            </c:forEach>
        </form:select>
        <input type="submit" value="Change"/>
        </div>
    </form:form>
</logic:equal>
<logic:equal name="diagramm" property="editor" value="${user.mail}">
    <form:form modelAttribute="diagramm" class="module">
        <div class="element">
        <form:input path="width" onkeyup="this.value=this.value.replace(/[^\d]/,'')"/>
        <form:input path="height" onkeyup="this.value=this.value.replace(/[^\d]/,'')"/>
        <input type="submit" value="Save"/>
       
        <form:textarea path="data"
                       id="UC_editor_for_CaseTool"
                       style="width:606px;height:300px"/>
         </div>

    </form:form>
    <div id="blocderoulant_error"> 
        <div id="deroulant_error">
            <textarea id="UC_errors_for_CaseTool" readonly="true" >
            </textarea>
        </div>
        <div id="blocaction_error"> 
            Error
        </div>
    </div>
    <div id="blocderoulant_console"> 
        <div id="deroulant_console">
            <textarea id="UC_console_for_CaseTool" readonly="true" >
            </textarea>
        </div>
        <div id="blocaction_console"> 
            Console
        </div>
    </div>

</logic:equal>
<logic:notEqual name="diagramm" property="editor" value="${user.mail}">
    <textarea
        id="UC_editor_for_CaseTool"
        style="width:606px;height:300px" disabled="true">${diagramm.data}
    </textarea>
</logic:notEqual>